import request from '@/utils/request'
// 获取部门列表
export function getdepartments() {
  return request({
    url: '/company/department',
    method: 'get'
  })
}

// 新增部门
export function adddepartments(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

// 根据id查询部门详情
export function refDepartments(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'get'
  })
}

// 修改部门详情
export function updateDepartments(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}
// 修改部门详情
export function delDepartments(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}
